import React,{Component} from "react";
import  "../css/title.css"
import {Button} from 'antd'

interface IState {
    width:number
}

export default class Home extends Component<any, IState>{

    constructor(props : any,context :any) {
        super(props,context);
        this.state ={
            width :400
        }
    }

    changeWidth= ()=>{
        this.setState((state,props) =>({
            width: state.width-10
        }))
    }

    render(){
        return (
            // <div className="title">
            //     <button>change</button>
            // </div>
            <div>
                <div style={{
                    width : '${this.state.width}px' ,
                    backgroundColor:"red"
                }}>
                    home page
                </div>
                <Button type="primary">change</Button>
            </div>
        )
    }
}
